package com.js.nickcar.entity.remote;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by LZY on 2017/10/4.
 */

public class CarModelYearBean implements Parcelable {

    private String car_model_year_id;
    private String year;
    private boolean selected;
    private ArrayList<CarModelBean> models = new ArrayList<>();

    public String getCar_model_year_id() {
        return car_model_year_id;
    }

    public void setCar_model_year_id(String car_model_year_id) {
        this.car_model_year_id = car_model_year_id;
    }

    public ArrayList<CarModelBean> getModels() {
        return models;
    }

    public void setModels(ArrayList<CarModelBean> models) {
        this.models = models;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    @Override
    public String toString() {
        return "CarModelYearBean{" +
                "car_model_year_id='" + car_model_year_id + '\'' +
                ", year='" + year + '\'' +
                ", selected=" + selected +
                ", models=" + models +
                '}';
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.car_model_year_id);
        dest.writeString(this.year);
        dest.writeByte(this.selected ? (byte) 1 : (byte) 0);
        dest.writeTypedList(this.models);
    }

    public CarModelYearBean() {
    }

    protected CarModelYearBean(Parcel in) {
        this.car_model_year_id = in.readString();
        this.year = in.readString();
        this.selected = in.readByte() != 0;
        this.models = in.createTypedArrayList(CarModelBean.CREATOR);
    }

    public static final Creator<CarModelYearBean> CREATOR = new Creator<CarModelYearBean>() {
        @Override
        public CarModelYearBean createFromParcel(Parcel source) {
            return new CarModelYearBean(source);
        }

        @Override
        public CarModelYearBean[] newArray(int size) {
            return new CarModelYearBean[size];
        }
    };
}
